{% extends 'layout.njk' %}
{% block content %}
    <div>
        age:<input class='age'>
    </div>
    <div>
        gender:<select class='gender'>
            <option value='0'>女</option>
            <option value='1'>男</option>
        </select>
    </div>
    <div>
        <button class='btn'>
            注册
        </button>
    </div>
{% endblock %}
{% block script %}
    <script>
        let ageEle = document.getElementsByClassName('age')[0]
        let genderEle = document.getElementsByClassName('gender')[0]
        let btnEle = document.getElementsByClassName('btn')[0]

        btnEle.onclick = function(){
            if(ageEle.value > 120){
                alert('年龄不符合要求')
            }else{
                location.href = '/login'
            }

        }
        
    </script>
{% endblock %}